﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddOrderField.aspx.cs"
    Inherits="ZX.WebApp.Crm.Sale.AddOrderField" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/layout/assets/skins/sam/layout.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/yui_2.9.0/build/datatable/assets/skins/sam/datatable.css" />
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/resize/resize-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>
    <script src="../../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.json-2.2.js" type="text/javascript"></script>
    <script src="../../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../../Scripts/CombinButton.js" type="text/javascript"></script>
    <script src="../../Scripts/extend.validate.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.calendar.js" type="text/javascript"></script>
    <link href="../../Styles/default/calendar.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/base.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/extendTable.css" rel="stylesheet" type="text/css" />
</head>
<script src="../../Scripts/Appjs/model.AddOrderField.Extend.js" type="text/javascript"></script>
<body class="yui-skin-sam" onkeydown="PreventBSK()">
    <form id="form1" runat="server">
    <div>
        <div id="toolbar" style="margin-top: 12px; text-align: center;">
            <button type="button" id="btnSave" name="btnSave">
                保存</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <button type="button" id="btnClose" name="btnClose">
                取消</button>
        </div>
        <div class="fieldForm" id="fieldForm">
            <div id="content">
                <h3>
                    客户基本信息</h3>
                <table class="table1">
                    <tr>
                        <th>
                            <span style="color: Red;">*</span><span>单号</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="Code" name="Code" readonly="readonly" class="width60" />
                        </td>
                        <td colspan="2">
                            &nbsp;
                        </td>
                        <th>
                            <span style="color: Red;">*</span><span>订单日期</span>
                        </th>
                        <td>
                            <input runat="server" type="text" id="Date" readonly="readonly" name="Date" class="width60" />
                        </td>
                    </tr>
                    <tr>
                        <th width="10%">
                            <span style="color: Red;">*</span><span>客户名称</span>
                        </th>
                        <td width="23%">
                            <input type="hidden" id="CustomerCode" name="CustomerCode" runat="server" />
                            <input type="text" id="CustomerName" name="CustomerName" class="width60" runat="server" />
                            <button id="btnCustomerCode" name="M" type="button" runat="server" class="btnCheck"
                                style="height: 25px;">
                                选择</button>
                        </td>
                        <th width="10%">
                            <span>客户编码</span>
                        </th>
                        <td width="23%">
                            <input type="text" id="txtCustomerCodes" name="txtCustomerCodes" readonly="readonly"
                                runat="server" class="width60" />
                        </td>
                        <th width="10%">
                            <span>客户类型</span>
                        </th>
                        <td width="23%">
                            <input type="text" id="CustomerType" name="CustomerType" readonly="readonly" class="width60"
                                runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span>员工人数</span>
                        </th>
                        <td>
                            <input type="text" id="PersonId" name="PersonId" readonly="readonly" class="width60"
                                runat="server" />
                        </td>
                        <th>
                            <span>所属行业</span>
                        </th>
                        <td>
                            <input type="text" id="TradeId" name="TradeId" readonly="readonly" class="width60"
                                runat="server" />
                        </td>
                        <th>
                            <span>成立日期</span>
                        </th>
                        <td>
                            <input type="text" id="CreateDate" name="CreateDate" readonly="readonly" class="width60"
                                runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span>主营产品</span>
                        </th>
                        <td>
                            <input type="text" id="CompanyProduct" name="CompanyProduct" readonly="readonly"
                                class="width60" runat="server" />
                        </td>
                        <th>
                            <span>行销顾问</span>
                        </th>
                        <td>
                            <input type="text" id="SaleadName" runat="server" class="width60" readonly="readonly" />
                        </td>
                        <th>
                            <span>信息专员</span>
                        </th>
                        <td>
                            <input type="text" id="AddUserName" runat="server" class="width60" readonly="readonly" />
                        </td>
                    </tr>
                </table>
                <h3>
                    订单信息</h3>
                <table class="table1">
                    <tr>
                        <th width="10%">
                            <span style="color: Red;">*</span><span>业绩归属</span>
                        </th>
                        <td width="23%">
                            <input type="hidden" id="DeptId" name="DeptId" runat="server" />
                            <input id="txtDeptId" name="txtDeptId" runat="server" readonly="readonly" type="text"
                                class="width60" />
                            <button id="btnDeptId" name="G" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th width="10%">
                            <span style="color: Red;">*</span><span>付款方式</span>
                        </th>
                        <td width="23%">
                            <asp:DropDownList ID="PaymentId" name="PaymentId" runat="server" CssClass="width65"
                                AppendDataBoundItems="true">
                                <%--<asp:ListItem Value=""></asp:ListItem>--%>
                            </asp:DropDownList>
                        </td>
                        <th width="10%">
                            <span>汇率</span>
                        </th>
                        <td width="23%">
                            <asp:DropDownList ID="PillID" name="PillID" runat="server" CssClass="width65">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span style="color: Red;">*</span><span>订单类型</span>
                        </th>
                        <td>
                            <asp:DropDownList ID="TypeID" name="TypeID" runat="server" CssClass="width65" Enabled="false">
                            </asp:DropDownList>
                        </td>
                        <th>
                            <span><span style="color: Red;">*</span>币别</span>
                        </th>
                        <td>
                            <asp:DropDownList ID="ValutaID" name="ValutaID" runat="server" CssClass="width65">
                            </asp:DropDownList>
                        </td>
                        <th>
                            <span><span style="color: Red;">*</span>订单状态</span>
                        </th>
                        <td>
                            <asp:DropDownList ID="StateID" name="StateID" runat="server" CssClass="width65">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span style="color: Red;">*</span><span>场次费</span>
                        </th>
                        <td>
                            <input type="text" runat="server" id="TotalMoney" name="TotalMoney" onkeyup="if(isNaN(value))execCommand('undo')"
                                onafterpaste="if(isNaN(value))execCommand('undo')" value="0" class="width60" />
                        </td>
                        <th>
                            <span style="color: Red;">*</span><span>推广讲师</span>
                        </th>
                        <td>
                            <input type="hidden" id="TeacherId" name="TeacherId" runat="server" />
                            <input id="txtTeacherId" name="txtTeacherId" runat="server" readonly="readonly" type="text"
                                class="width60" />
                            <button id="btnTeacherId" name="JS" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                        <th>
                            <span style="color: Red;">*</span><span>讲场时间</span>
                        </th>
                        <td>
                            <input id="txtTeacherTime" name="txtTeacherTime" runat="server" type="text" readonly="readonly"
                                class="width60" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span style="color: Red;">*</span><span>讲场地点</span>
                        </th>
                        <td>
                            <input id="txtTeacherAddress" name="txtTeacherAddress" runat="server" type="text"
                                maxlength="40" class="width60" />
                        </td>
                        <th>
                            <span style="color: Red;">*</span><span>讲场类型</span>
                        </th>
                        <td>
                            <asp:DropDownList ID="drpTeacherType" runat="server" CssClass="width65">
                                <asp:ListItem Value=""> </asp:ListItem>
                                <asp:ListItem Value="A">上午</asp:ListItem>
                                <asp:ListItem Value="P">下午</asp:ListItem>
                                <asp:ListItem Value="N">晚上</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <th>
                            <span style="color: Red;">*</span><span>助约人</span>
                        </th>
                        <td>
                            <input type="hidden" id="ZhuYueRenID" name="ZhuYueRenID" runat="server" />
                            <input id="txtZhuYueRenID" name="txtZhuYueRenID" runat="server" readonly="readonly" type="text"
                                class="width60" />
                            <button id="btnZhuYueRenID" name="Z" type="button" class="btnCheck" style="height: 25px;">
                                选择</button>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <span>备注</span>
                        </th>
                        <td colspan="5">
                            <textarea runat="server" id="Explain" name="Explain" style="width: 53%; height: 60px;"></textarea>
                        </td>
                    </tr>
                </table>
                <h3>
                    接洽人信息</h3>
                <table class="table1">
                    <tr>
                        <th width="10%"><input type="hidden" id="LinkManId" runat="server" value="00000000-0000-0000-0000-000000000000" />
                        <span id="spanLinkManName" style="color: Red;">*</span><span>接洽人姓名</span></th>
                        <td width="23%">
                            <input type="text" id="LinkManName" runat="server" maxlength="30" class="width60" onblur="return CheckLinkManName(this.value);" />
                        </td>
                        <th width="10%"><span id="spanLinkManSex" style="color: Red;">*</span><span>接洽人性别</span></th>
                        <td width="23%">
                            <asp:DropDownList ID="LinkManSex" runat="server" CssClass="width65" AppendDataBoundItems="true">
                                <asp:ListItem Value=""></asp:ListItem>
                                <asp:ListItem Value="M">男</asp:ListItem>
                                <asp:ListItem Value="F">女</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <th width="10%"><span id="spanLinkManPosition" style="color: Red;">*</span><span>接洽人职位</span></th>
                        <td width="23%">
                            <input type="text" id="LinkManPosition" runat="server" maxlength="20" class="width60" />
                        </td>
                    </tr>
                    <tr>
                        <th><span id="spanLinkManTel" style="color: Red;">*</span><span>接洽人手机</span></th>
                        <td>
                            <input type="text" id="LinkManTel" runat="server" maxlength="20" class="width60" />
                        </td>
                        <td colspan="4">&nbsp;</td>
                    </tr>
                </table>
            </div>
        </div>
        <div id="dialog1" class="yui-pe-content">
            <div class="hd">
                客户选择</div>
            <div class="bd">
                <iframe id="EditUIWindow1" frameborder="0" src="" style="width: 100%; height: 100%;
                    margin: 0px; padding: 0px;"></iframe>
            </div>
        </div>
        <div id="dialog2" class="yui-pe-content">
            <div class="hd">
                业绩归属选择</div>
            <div class="bd">
                <iframe id="EditUIWindow2" frameborder="0" src="" style="width: 100%; height: 100%;
                    margin: 0px; padding: 0px;"></iframe>
            </div>
        </div>
        <asp:HiddenField ID="ID" runat="server" />
    </div>
    </form>
    <form id="form2" style="display: none" action="../../Extend/AjaxData/CustomOperating.aspx">
    <textarea style="display: none" id="jsonDataContent" rows="2" cols="2" name="jsonDataContent"></textarea>
    </form>
</body>
<script type="text/javascript">
    var Url = "../../Extend/AjaxData/CustomOperating.aspx";
    var flag = "<%=Flag %>",entity = "<% =EntityName %>",
        action = "<% =DataAction %>",uname="<%=UName %>",
        tempBtnName="<%=BtnName %>",userid="<%=UserID %>";
    var myDataSource1, mDataTable1;
    var btnSave = "", btnClose = "",btnPay="",condition = "";
    <asp:Literal ID="EditTemplate" runat="server"></asp:Literal>

    (function () {
        //debugger
        $("#btnCustomerCode").attr("name",tempBtnName);
        $("#txtTeacherTime").cld();
        $("#Date").cld();
        //接洽人手机只能为数字
        $("#LinkManTel").keypress(function (e) {
            //注意此处不要用keydown方法，否则不能禁用Ctrl+C与Ctrl+V,具体原因请自行查找keyPress与keyDown区分，十分重要，请细查
            if ($.browser.msie) {  //判断浏览器
                if (((event.keyCode > 47) && (event.keyCode < 58)) || (event.keyCode == 8)) { //判断键值 
                    return true;
                } else {
                    return false;
                }
            } else {
                if (((e.which > 47) && (e.which < 58)) || (e.which == 8) || (event.keyCode == 17)) {
                    return true;
                } else {
                    return false;
                }
            }
        }).focus(function () {
            this.style.imeMode = 'disabled'; //禁用输入法,禁止输入中文字符
        }).bind("paste", function () {
            //alert($("#text").val());
            //return false;
        }).keyup(function (e) {
            _v = $("#LinkManTel").val();
            for (_i = 0; _i < _v.length; _i++) {
                _c = _v.charAt(_i);
                if (isNaN(_c)) {
                    $("#LinkManTel").val("");
                    return;
                }
            }
        });

        GetState(flag);
        var Dom = YAHOO.util.Dom,
            Event = YAHOO.util.Event;
        Event.onDOMReady(function () {
            var layout = new YAHOO.widget.Layout({
                units: [
                { position: 'bottom', height: 60, body: 'toolbar', gutter: '1 1 1 1', scroll: null, zIndex: 2 },
                { position: 'center', body: 'fieldForm', gutter: '0 1 1 1', scroll: true }
                ]
            });
            layout.render();
        });
    })();
    
    //关闭当前页
    var Close = function () {
        window.parent.$("#tabs").tabs('close', '<%=PageTitle %>');
    }
</script>
</html>
